package com.gitee.cirnochat.group.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.cirnochat.group.model.enums.GroupApplyStatus;
import com.gitee.cirnochat.group.model.enums.GroupJoinType;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 群聊请求记录
 * @TableName group_apply
 */
@TableName(value ="group_apply")
@Data
public class GroupApply implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 请求者ID
     */
    @TableField(value = "from_id")
    private Long fromId;

    /**
     * 群组ID
     */
    @TableField(value = "group_id")
    private Long groupId;

    /**
     * 请求状态：待处理/已接受/已拒绝
     */
    @TableField(value = "status")
    private GroupApplyStatus status;

    /**
     * 请求类型：加入群聊/邀请入群
     */
    @TableField(value = "type")
    private GroupJoinType type;

    /**
     * 验证信息
     */
    @TableField(value = "message")
    private String message;

    /**
     * 邀请者ID
     */
    @TableField(value = "invitor_id")
    private Long invitorId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}